package yanglib.session;

import yanglib.message.Message;

import java.io.IOException;
import java.nio.ByteBuffer;

/**
 * Created with IntelliJ IDEA.
 * User: user
 * Date: 9/9/14
 * Time: 1:32 PM
 * To change this template use File | Settings | File Templates.
 */
public class Request extends Message {

    private long requestID;
    public Request(ByteBuffer buffer) {
        super(buffer);
    }

    public Request(int type, int sender) {
        super(type, sender);
    }

    protected void setRequestID(long requestID){
        this.requestID = requestID;
    }

    public long getRequestID(){
        return this.requestID;
    }

    public void serialize(ByteBuffer buffer){
        super.serialize(buffer);
        buffer.putLong(this.requestID);
    }

    public void deserialize(ByteBuffer buffer) throws IOException {
        super.deserialize(buffer);
        this.requestID = buffer.getLong();
    }
}
